import routes from '@/routes'
import { createRouter,createWebHistory } from 'vue-router'
import {useGlobalData} from '@/store/global'
import pinia from '@/store'

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

const global = useGlobalData(pinia);
router.beforeEach((to, from, next) => {
	if (to.meta.fullscreen) {
		 global.fullscreen = true
	}
	if(to.meta.loginUrl){
		global.loginUrl = true
	}
	next();
	
});


export default router

